package de.fzi.kasma.learner.function.kernel.rdf;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import de.fzi.kasma.learner.path.PathGraph;
import edu.unika.aifb.graphindex.index.DataIndex;

public class Color {
	public static KernelCache m_kc;
	public static int m_colorId = 0;

	private int m_size;
	private int m_id = ++m_colorId;
	private String m_name = "c" + m_id;

	private String m_color;

	private Partition m_par;

	public Color(KernelCache kc) {
		m_kc = kc;
	}

	public void add(Integer element) {
		m_kc.setNodeColor(element, this);
		Set<Integer> st = new HashSet<Integer>();
		st.add(element);
		m_kc.addNodesToColor(this, st);
		m_size++;
	}

	public int getId() {
		return m_id;
	}

	public void setSize(int size) {
		m_size = size;
	}

	public int size() {
		return m_size;
	}

	public Set<Integer> getElements(Partition p) {
		return m_kc.getElements(p, this);
	}

	public void setColor(String c) {
		m_color = c;
	}

	public String getColor() {
		return m_color;
	}

	public void removeElement(Integer element) {
		m_kc.removeElement(this, element);
		m_kc.clearColor(element, this);
	}
}
